#ifndef MAINWINDOW_H_
#define MAINWINDOW_H_

#include <QtGui/QMainWindow>
#include <QListWidget>
#include <QtSql>

#include "ui_MainWindow.h"


class RatingItem
{
public:
	RatingItem() : rate(-1) {};

	int rate;
	QVariant id;
	QVariant url;

	QString title;
	QString album;
	QString artist;
};



class MainWindow : public QMainWindow
{
	Q_OBJECT

public:

	MainWindow(QWidget *parent = 0);
	virtual ~MainWindow();


private slots:
	bool browseFile();
	bool connectDB();
	bool saveToFile();
	bool toXml();
	bool toDb();

private:
	bool retrieveDBRatings();
	bool retrieveFile();
	void displayRateItems(QTableWidget *tabWgt, const QList<RatingItem>& listRates);

private:
	Ui::MainWindow ui;
	QSqlDatabase m_DB;
	QFile m_file;
	QList<QString> argsList;

	QList<RatingItem> listDb;
	QList<RatingItem> listXml;
};


#endif /* MAINWINDOW_H_ */

